﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>GetLayerByUrl</title>
    <script src="../../lib/XiaoFuMap.js" type="text/javascript"></script>
    <script type="text/javascript">

        var map, control, layer, glayer;
        function load() {
            map = new XiaoFu.Map("#MapContainer");
            layer = new XiaoFu.GoogleCacheLayer(GoogleUrl.Map);
            map.addLayer(layer);
            glayer = new XiaoFu.GoogleCacheLayer(GoogleUrl.Satellite);
            glayer.isBaseLayer = false;
            glayer.setVisiable(false);
            map.addLayer(glayer);
            control = new XiaoFu.Navigation();
            map.addControl(control);
        }
        function showMap(index) {
            if (index == 1) {
                glayer.hide();
                layer.show();
            }
            else {
                glayer.show();
                layer.hide();
            }
         };
        function showMsg(_msg) {
            $("#msg").html(_msg);
        }
    </script>
</head>
<body onload="load()">
    <div id="MapContainer" style="z-index: 10000; border: 1px solid blue; position: relative;
        width: 1000px; height: 500px;">
    </div>     
    <input type="button" value="影像地图" onclick="showMap(0);" />
    <input type="button" value="矢量地图" onclick="showMap(1);" />
    <div id="msg">
    </div>
</body>
</html>
